package com.ybkj.daijia.server.service.impl;

import com.ybkj.daijia.server.mapper.WxLocationMapper;
import com.ybkj.daijia.server.model.WxLocation;
import com.ybkj.daijia.server.service.WxLocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class DefaultWxLocationService implements WxLocationService {

    @Autowired
    private WxLocationMapper wxLocationMapper;

    @Override
    public WxLocation findLastedByWxuser(final String fromUser) {

        return wxLocationMapper.selectLast(fromUser);

    }

    @Transactional(rollbackFor = Exception.class)
    public WxLocation save(WxLocation wxLocation) {

        wxLocationMapper.insertRecord(wxLocation);
        return wxLocation;

    }


}
